package com.mshop.service;

import java.util.List;

import com.mshop.fw.modules.CommonService;
import com.mshop.po.SysMenu;
import com.mshop.util.QL;

public class SysMenuService extends CommonService {
	public List<SysMenu> list(String fatherId) {
		return dao.find(SysMenu.class, QL.HQL.SYSMENU.LIST, new Object[] {new Long(fatherId)});
	}
	
	public List<SysMenu> list(String fatherId,String managerId) {
		return dao.find(SysMenu.class, QL.HQL.SYSMENU.LIST_BY_POWER, new Object[] {new Long(fatherId),new Long(managerId)});
	}

	public void save(SysMenu sysMenu) {
		dao.save(sysMenu);
	}

	public SysMenu load(String id) {
		return dao.load(SysMenu.class, new Long(id));
	}
	
	public SysMenu get(String id) {
		return dao.get(SysMenu.class, new Long(id));
	}

	public void delete(String id) {
		dao.delete(this.get(id));
	}
}
